<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<meta name="description" content="">
<meta name="author" content="">

<title>发布信息</title>

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>




</head>

<body>


	<%@include file="navbar.jsp"%>

	<%--返回错误信息--%>
	<%
		String s = (String)request.getAttribute("error_msg");
		if (s!=null){%>
		<div class="alert alert-warning" style="margin-top: 50px">
		<a href="#" class="close" data-dismiss="alert">
			&times;
		</a>
		<%=s%>
	</div>
	<%}%>

、

	<!--margin:0px auto; 左右居中-->
	<div class="container-fluid" style="max-width: 60%; padding-top: 40px;">

		<div class="page-header">
			<h1>完善信息</h1>
		</div>


		<form class="form-horizontal" action="addGoods" name="form" onsubmit="return beforeSubmit();"  method="post" enctype="multipart/form-data">
			<div class="form-group">
				<label class="col-sm-2 control-label">商品类别</label>
				<div class="col-sm-10">
					<select  name="type_id"
						class="selectpicker show-tick form-control">
						<c:forEach items="${Alltype}" var="type">
						<option value="${type.type_id}">${type.type_name}</option>
						</c:forEach>
						<%--<option value="2">零食</option>--%>
						<%--<option value="3">书籍</option>--%>
						<%--<option value="4">服饰</option>--%>
						<%--<option value="5">小家电</option>--%>
						<%--<option value="6">数码产品</option>--%>
						<%--<option value="7">医药</option>--%>
						<%--<option value="8">文具</option>--%>
						<%--<option value="9">生活用品</option>--%>
						<%--<option value="10">车用产品</option>--%>
						<%--<option value="11">配饰</option>--%>
						<%--<option value="12">其他</option>--%>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">新旧程度</label>
				<div class="col-sm-10">
					<select name="old_level"
						class="selectpicker show-tick form-control">
						<c:forEach items="${Alllevel}" var="level" varStatus="status">
							<option value="${level.old_level}">${level.old_des}</option>
						</c:forEach>

					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">商品价格</label>
				<div class="col-sm-10" style="display: inline-block">
					<input type="number" min="0" max="9999" class="form-control" id="goods_price" name="goods_price" placeholder="单位:元" required>

				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label">商品标题</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="goods_name" placeholder="二十字以内" required maxlength="20">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">商品介绍</label>
				<div class="col-sm-10">
					<textarea class="form-control" rows="3" name="goods_describe" placeholder="介绍一下该物品……" required ></textarea>
				</div>
			</div>

			<div class="form-group">
				<label  class="col-sm-2 control-label" required>交易地点</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="trade_place" placeholder="具体交易地点" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">上传图片</label>
				<div class="col-sm-10">
					<div class="panel panel-default ">
						<div class="panel-heading">选择上传图片</div>
						<div class="panel-body">

							<img id="goodsPic" src="/market/images/image.png"  width="200px" height="200px" style="padding: 5px">
							<input  id="goodsPicUp" name="pic_file" accept="image/*" type="file" style="display: none" />

						</div>
					</div>
				</div>
			</div>

			<h4>
				<b>联系方式</b>
			</h4>
			<div class="form-group">
				<label class="col-sm-2  control-label">联系人</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="contact_name" placeholder="例：张先生" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">联系电话</label>
				<div class="col-sm-10">
					<input type="number" class="form-control" name="telephone" placeholder="" required maxlength="11">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">QQ/微信</label>
				<div class="col-sm-10">
					<input type="text"  class="form-control" id="qq_number" name="qq_number" placeholder="可不填">
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-10">
					<button  class="btn  btn-primary btn-block" type="submit" id="goods_submit_btn">发布</button>

				</div>
			</div>



		</form>


	</div>


	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/market/js/goods-publish.js"></script>
	<script src="/market/js/common.js"></script>
</body>
</html>